<!--
 * @Author: Smthie Smthie@qq.com
 * @Date: 2024-05-13 10:06:44
 * @LastEditors: Smthie Smthie@qq.com
 * @LastEditTime: 2024-05-31 10:36:35
 * @FilePath: \ProtocolTool\src\renderer\src\App.vue
-->
<script setup lang="ts">
// @ts-ignore
import zhCN from 'ant-design-vue/es/locale/zh_CN'
import dayjs from 'dayjs'
import 'dayjs/locale/zh-cn'
import { message } from 'ant-design-vue'

// 语言配置
dayjs.locale('zh-cn')
const locale = computed(() => zhCN)
// 全局消息配置
message.config({ top: '120px' })
// 全局Loading
const loading = ref(false)
const tip = ref('Loading...')
const toggleLoading = (status: boolean, msg = 'Loading...') => {
  loading.value = status
  tip.value = msg
}
provide('toggleLoading', toggleLoading)
</script>

<template>
  <a-config-provider :locale="locale">
    <a-spin :spinning="loading" size="large" :tip>
      <router-view></router-view>
    </a-spin>
  </a-config-provider>
</template>
<style scoped>
/* 阿里字体图标设置 */
.icon,
.iconfont {
  font-family: 'iconfont' !important;
  font-size: 16px;
  font-style: normal;
  -webkit-font-smoothing: antialiased;
  -webkit-text-stroke-width: 0.2px;
  -moz-osx-font-smoothing: grayscale;
}

.ant-btn-primary {
  background-color: rgb(0, 185, 107);
}
</style>
